<?php

	/**
	 * Workspace@ Engine application comment!
	 * 
	 * LICENSE
	 * This application is licensed under New BSD license.
	 * Please read complete LICENSE.txt inside of root folder for more details.
	 * 
	 * We wish you good building :) 
	 * 
	 * @category   Application
	 * @package    Bootstrap
	 * @author     Nevio Vesic <nevio@workspaceat.com>
	 * @copyright  2008-2009 Workspace@ group in association with Design strategist
	 */
	
	
	class Engine_Plugins_Updates extends Engine_Application_Abstract
	{
		
		protected $db          = null;
		
		protected $server      = null;
		
		protected static $testpage = "test.phtml";
		
		function __construct()
		{
			$this->db = $this->databaseInstance();
			
			# lets gather server info from ini file
			$this->server["url"] = self::$system -> updates -> server -> loc;
		}
		
		public function retriveConnection()
		{
			$a = self::$system -> updates -> server -> loc . self::$testpage;
	
			if ( @fopen( $a, "r", true ) )
			{
				return array(
					"status" => "true",
					"message" => "Server successfully contacted! We are now checking if new updates are available..."
				);	
			}
			else
			{
				return array(
					"status" => "false",
					"message" => "Ops! There was error with contacting server! Please connect to internet!"
				);	
			}

		}
		
		public function checkUpdates()
		{
			
		}
		
		public function doUpgrade()
		{
			
		}
		
		public function restoreVersion( $version_id )
		{
			
		}
		
	}

